.arg(degrees2ddmm(waypointp->latitude), 11, 'f', 3)
.arg(degrees2ddmm(waypointp->longitude), 11, 'f', 3);
}
-
+
if (snopt) {
key.append(waypointp->shortname);
}
// Panasonic DMC-TZ10 stores datum with trailing spaces.
// Kodak stores zero count ASCII tags.
QByteArray buf = (tag->count == 0) ? QByteArray("") : tag->data.at(0).toByteArray();
- // If the bytearray contains internal NULL(s), get rid of the first and
+ // If the bytearray contains internal NULL(s), get rid of the first and
// anything after it.
if (auto idx = buf.indexOf('\0'); idx >= 0) {
buf = buf.left(idx);
exif_put_double(GPS_IFD, GPS_IFD_TAG_TIMESTAMP, 0, dt.time().hour());
exif_put_double(GPS_IFD, GPS_IFD_TAG_TIMESTAMP, 1, dt.time().minute());
exif_put_double(GPS_IFD, GPS_IFD_TAG_TIMESTAMP, 2,
- static_cast<double>(dt.time().second()) +
+ static_cast<double>(dt.time().second()) +
static_cast<double>(dt.time().msec())/1000.0);
exif_put_str(GPS_IFD, GPS_IFD_TAG_DATESTAMP, CSTR(dt.toString(u"yyyy:MM:dd")));
class fltinfo_t {
public:
- bool isDynamic() {
+ bool isDynamic() const {
return factory != nullptr;
}
explicit operator bool() const {
* it’s in <qhashfunctions.h>, a public header.
*/
QtPrivate::QHashCombine hash;
-
+
seed = hash(seed, c.shortname.toUpper());
seed = hash(seed, c.lat);
seed = hash(seed, c.lon);
#define MYNAME "geo"
-void GeoFormat::GeoReadLoc(QXmlStreamReader& reader) const
+void GeoFormat::GeoReadLoc(QXmlStreamReader& reader)
{
Waypoint* wpt = nullptr;
QString current_tag;
/* Member Functions */
- void GeoReadLoc(QXmlStreamReader& reader) const;
+ static void GeoReadLoc(QXmlStreamReader& reader);
void geo_waypt_pr(const Waypoint*, QXmlStreamWriter& writer);
static Geocache::container_t wpt_container(const QString&);
ff_type get_type() const override
{
- return ff_type_file;
+ return ff_type_file;
}
QVector<ff_cap> get_cap() const override
void rd_init(const QString& fname) override
{}
void read() override;
-
+
private:
/* Constants */
* file. So we map from the namespaceUris to the prefixes used in our
* hash table.
*/
- static const QHash<QString, QString> tag_ns_prefixes = {
+ static const QHash<QString, QString> tag_ns_prefixes = {
{"http://www.garmin.com/xmlschemas/GpxExtensions/v3", "gpxx"},
{"http://www.garmin.com/xmlschemas/TrackPointExtension/v1", "gpxtpx"},
{"http://www.groundspeak.com/cache/1/0", "groundspeak"},
#include <QString> // for QString
#include <QVector> // for QVector
-#include "defs.h"
+#include "defs.h"
#include "gbfile.h" // for gbfseek, gbfputc, gbfputint32, gbfputflt
#include "jeeps/gpsmath.h" // for GPS_Math_Known_Datum_To_WGS84_M
#include "src/core/datetime.h" // for DateTime
return str;
}
-QByteArray IgcFormat::date2str(const gpsbabel::DateTime& dt) const
+QByteArray IgcFormat::date2str(const gpsbabel::DateTime& dt)
{
QByteArray str = dt.toUTC().toString("ddMMyy").toUtf8();
if (str.size() != 6) {
return str;
}
-QByteArray IgcFormat::tod2str(const gpsbabel::DateTime& tod) const
+QByteArray IgcFormat::tod2str(const gpsbabel::DateTime& tod)
{
QByteArray str = tod.toUTC().toString("hhmmss").toUtf8();
if (str.size() != 6) {
* @return The number of seconds to add to the GNSS track in order to align
* it with the pressure track.
*/
-int IgcFormat::correlate_tracks(const route_head* pres_track, const route_head* gnss_track) const
+int IgcFormat::correlate_tracks(const route_head* pres_track, const route_head* gnss_track)
{
double alt_diff;
double speed;
* A factor can never be zero, so this looks good to me.
* Be careful.
*/
- int get_ext_factor(igc_ext_type_t type) const
+ static int get_ext_factor(igc_ext_type_t type)
{
int ret = 0;
switch (type) {
void detect_gnss_track(const route_head*);
void detect_other_track(const route_head*, int& max_waypt_ct);
void get_tracks(const route_head**, const route_head**);
- QByteArray latlon2str(const Waypoint*);
- QByteArray date2str(const gpsbabel::DateTime&) const;
- QByteArray tod2str(const gpsbabel::DateTime&) const;
+ static QByteArray latlon2str(const Waypoint*);
+ static QByteArray date2str(const gpsbabel::DateTime&);
+ static QByteArray tod2str(const gpsbabel::DateTime&);
void wr_header();
void wr_task_wpt_name(const Waypoint*, const char*);
void wr_task_hdr(const route_head*, unsigned int task_num);
void wr_task_tlr(const route_head*);
void wr_tasks();
void wr_fix_record(const Waypoint*, int, int);
- int correlate_tracks(const route_head*, const route_head*) const;
+ static int correlate_tracks(const route_head*, const route_head*);
void wr_track();
/* Data Members */
}
-QString KmlFormat::kml_geocache_get_logs(const Waypoint* wpt) const
+QString KmlFormat::kml_geocache_get_logs(const Waypoint* wpt)
{
QString r;
static QString kml_lookup_gc_icon(const Waypoint* waypointp);
static const char* kml_lookup_gc_container(const Waypoint* waypointp);
static QString kml_gc_mkstar(int rating);
- QString kml_geocache_get_logs(const Waypoint* wpt) const;
+ static QString kml_geocache_get_logs(const Waypoint* wpt);
void kml_write_data_element(const QString& name, const QString& value) const;
void kml_write_data_element(const QString& name, int value) const;
void kml_write_data_element(const QString& name, double value) const;
{
if (!waypt_list.empty()) {
QList<WptRecord> qlist;
-
+
for (auto* const waypointp : waypt_list) {
qlist.append(WptRecord(waypointp));
}
int nelems = qlist.size();
-
+
for (int i = 0 ; i < nelems ; ++i) {
if (!qlist.at(i).deleted) {
bool something_deleted = false;
-
+
for (int j = i + 1 ; j < nelems ; ++j) {
if (!qlist.at(j).deleted) {
double dist = gc_distance(qlist.at(j).wpt->latitude,
qlist.at(j).wpt->longitude,
qlist.at(i).wpt->latitude,
qlist.at(i).wpt->longitude);
-
+
if (dist <= pos_dist) {
if (check_time) {
qint64 diff_time = std::abs(qlist.at(j).wpt->creation_time.msecsTo(qlist.at(i).wpt->creation_time));
continue;
}
}
-
+
qlist[j].deleted = true;
qlist.at(j).wpt->wpt_flags.marked_for_deletion = 1;
something_deleted = true;
}
}
}
-
+
if (something_deleted && (purge_duplicates != nullptr)) {
qlist.at(i).wpt->wpt_flags.marked_for_deletion = 1;
}
result = date.startOfDay(timespec, offset);
#endif
}
-
+
return result;
}
int xstrtoi(const char* str, char** str_end, int base)
{
-
+
long value = strtol(str, str_end, base);
if (value > INT_MAX) {
errno = ERANGE;
class fmtinfo_t {
public:
- bool isDynamic() {
+ bool isDynamic() const {
return factory != nullptr;
}
explicit operator bool() const {